package com.wyw.design.model.learning.structure.facade;

/**
 * @Title       门面
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * @Date 2023/3/29 15:22
 * Update History:
 * Author        Time            Content
 */
public class Facade {
    // 被委托的对象
    private FireSystem fireSystem;
    private UserSystem userSystem;

    public Facade(FireSystem fireSystem, UserSystem userSystem) {
        this.fireSystem = fireSystem;
        this.userSystem = userSystem;
    }

    // 模拟射击的门面接口 API
    public void shooting() {
        fireSystem.useBullet(); // 上子弹
        fireSystem.fire(); // 开火
        userSystem.loseBlood(); // 敌人掉血
        userSystem.addScore(); // 自己加分
    }
}
